]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Implement vfunc's for key focus in/out
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 12 Apr 2019 20:46:10 +0000 (15:46 -0500)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 15 May 2019 17:27:07 +0000 (17:27 +0000)
As per the fact the menu item is an object we can just vfunc's.
This is not possible for events as specific union object is passed instead of
just the Clutter.Event.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/499

js/ui/popupMenu.js

index 8cb0650d7518636b190bb742ae4806a612b34703..d068394e262e909b6aa12e650c01045a2c325b0c 100644 (file)
@@ -95,9 +95,6 @@ var PopupBaseMenuItem = GObject.registerClass({
         }
         if (params.reactive && params.hover)
             this.connect('notify::hover', this._onHoverChanged.bind(this));
-
-        this.connect('key-focus-in', this._onKeyFocusIn.bind(this));
-        this.connect('key-focus-out', this._onKeyFocusOut.bind(this));
     }
 
     get actor() {
@@ -161,11 +158,13 @@ var PopupBaseMenuItem = GObject.registerClass({
         return Clutter.EVENT_PROPAGATE;
     }
 
-    _onKeyFocusIn(actor) {
+    vfunc_key_focus_in() {
+        super.vfunc_key_focus_in();
         this.setActive(true);
     }
 
-    _onKeyFocusOut(actor) {
+    vfunc_key_focus_out() {
+        super.vfunc_key_focus_out();
         this.setActive(false);
     }